package com.lvmama.controller.rhino.page;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lvmama.client.rhino.PageClient;
import com.lvmama.common.result.Result;
import com.lvmama.pojo.dto.rhino.page.PageAnalysisDTO;

@Controller
@RequestMapping("/traffic")
public class TrafficController {

    @Autowired
    PageClient pageClient;

    @RequestMapping(value ="/landPageFlow",method = RequestMethod.GET)
    public String landPageFlow(ModelMap model) {
        return "pageAnalysis/landPageFlowList";
    }

    @RequestMapping(value ="/upDownstream")
    public String upDownstream(ModelMap model) {
        return "pageAnalysis/upDownstreamList";
    }


    @RequestMapping(value = "/regionData",method = RequestMethod.GET)
    @ResponseBody
    public Result<Map<String, Object>> regionData(PageAnalysisDTO pageAnalysisDTO) {
        return pageClient.regionData(pageAnalysisDTO);
    }

    @RequestMapping(value = "/landingPage",method = RequestMethod.GET)
    @ResponseBody
    public Result<Map<String, Object>> landingPageData( PageAnalysisDTO pageAnalysisDTO) {
        return pageClient.landingPageData(pageAnalysisDTO);
    }

    @RequestMapping(value = "/landingPageByNum",method = RequestMethod.GET)
    @ResponseBody
    public Result<Map<String, Object>> landingPageByNum(PageAnalysisDTO pageAnalysisDTO) {
        return pageClient.landingPageByNum(pageAnalysisDTO);
    }

    @RequestMapping(value = "/querylist",method = RequestMethod.GET)
    @ResponseBody
    public Result<Map<String, Object>> querylist(PageAnalysisDTO pageAnalysisDTO) {
        return pageClient.querylist(pageAnalysisDTO);
    }


    @RequestMapping(value = "/getChildCodeList",method = RequestMethod.POST)
    @ResponseBody
    public Result<Map<String, Object>> getChildCodeList(int parent_id) {
        return pageClient.getChildCodeList(parent_id);
    }


    @RequestMapping(value ="/conversionlist",method = RequestMethod.GET)
    @ResponseBody
    public Result<Map<String, Object>> channelList(PageAnalysisDTO pageAnalysisDTO) {
        return pageClient.channelList(pageAnalysisDTO);
    }

    @RequestMapping(value ="/channelDetailList",method = RequestMethod.GET)
    @ResponseBody
    public Result<Map<String, Object>> channelDetailList(PageAnalysisDTO pageAnalysisDTO) {
        return pageClient.channelDetailList(pageAnalysisDTO);
    }

    @RequestMapping(value ="/queryPageCode",method = RequestMethod.POST)
    @ResponseBody
    public Result<Map<String, Object>> queryPageCode( String categoryId) {
        return pageClient.queryPageCode(categoryId);
    }




}
